import { useEffect, useState } from "react"
function Time(porps) {
    let tiem = porps.tiem
    const [num, setNum] = useState(tiem)
    useEffect(() => {
        let a = setInterval(() => {
            tiem--
            if (tiem == 0) {
                clearInterval(a)
                porps.tiemChildren()
            } else {
                setNum(tiem)
            }
        }, 1000)
    }, [])
    return <a>{num}s</a>
}
export default Time